<table class="table table-bordered table-striped">
  <thead>
    <tr>
      <th>行业分组</th>
      <th>总时长</th>
      <th>已使用</th>
      <th>剩余</th>
      <th>总流量</th>
      <th>已使用</th>
      <th>剩余</th>
    </tr>
  </thead>
  <% @creditcards.each do |creditcard| %>
    <tr id='creditcard-<%= creditcard.id %>'>
      <td>
        <%= creditcard.terminal_group.try(:display_name) %>
      </td>
      <td>
        <%= creditcard.traffic_total > 0 ? creditcard.duration_total : "不限时长" %>
      </td>
      <td><%= creditcard.duration_used %></td>
      <td><%= creditcard.traffic_total > 0 ? creditcard.duration_rest : "不限时长" %></td>
      <td><%= creditcard.traffic_total > 0 ? nice_bytes(creditcard.traffic_total) : "不限流量" %></td>
      <td><%= nice_bytes creditcard.traffic_used.to_i %></td>
      <td><%= creditcard.traffic_total > 0 ? nice_bytes(creditcard.traffic_rest) : "不限流量" %></td>
    </tr>
  <% end %>
</table>
<div class="col-sm-12 text-right"><%= paginate @creditcards, :remote => true %></div></div>